package com.java.action;

import java.util.List;

import com.java.pojo.ComRole;
import com.java.service.IRoleService;
import com.opensymphony.xwork2.ActionSupport;

public class RoleAction extends ActionSupport{
	
	private IRoleService roleservice;
	private int page=1;
	private int endpage;
	private static int PAGEROW=5;
	private List<ComRole> rlist;
	
	private Integer message;
	
	
	public String execute(){
		
		
		int row_num = roleservice.getRolenum();
		endpage=row_num%PAGEROW==0?row_num/PAGEROW:row_num/PAGEROW+1;
		int start = (page-1)*PAGEROW;
		rlist=roleservice.getRoleList(start, PAGEROW);
		
		
		return SUCCESS;
	}




	public Integer getMessage() {
		return message;
	}




	public void setMessage(Integer message) {
		this.message = message;
	}




	public int getPage() {
		return page;
	}


	public void setPage(int page) {
		this.page = page;
	}


	public int getEndpage() {
		return endpage;
	}


	public List<ComRole> getRlist() {
		return rlist;
	}


	public void setRoleservice(IRoleService roleservice) {
		this.roleservice = roleservice;
	}

}
